<?php
defined('BASEPATH') OR exit('No direct script access allowed');
 
class My extends CI_Controller {

	 var $dbmain;

     function __construct()
	 {
		    parent::__construct();
            include_once "func.php";
            $this->dbmain = $db;
	 }

	public function invite_list(){

		$pageno = 1;
		if(isset($_GET['page_no'])){
			$pageno = $_GET['page_no'];
		}
		$pagesize = 10 ;
  	 	$rs_number = ($pageno - 1) * $pagesize ;


		$sql = "select a.*,a.id as invite_id,b.nickname,b.thumb,b.height,b.sex from invite a,member b where a.member_id=b.id order by a.id desc limit $rs_number,$pagesize";
		$inviteList = $this->dbmain->get_results($sql);
		$count = count($inviteList);
 
        $data = array(
			'invite_list' => $inviteList,
			'count' => $count,
			'page_no' => $pageno
		);
  
		ajax_return($data);
	}


	public function info(){

		// if(!isset($_GET["id"])){
		// 	exit;
		// }

 	 	$sql = "select a.* from member a where a.id='28'";
 	 	$member = $this->dbmain->get_row($sql);
  
        $data = array(
			'info' => $member
		);
  
		ajax_return($data);
	}



	public function index()
	{  
  
 	}

}
